package com.dubito.pattern.开闭原则;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * @author liliang
 * @date 2020/8/26.
 */
public class OffNovelBook extends NovelBook {

    public OffNovelBook(String name, double price, String author) {
        super(name, price, author);
    }

    @Override
    public double getPrice() {
        double v = super.getPrice() * 0.9;
        BigDecimal bigDecimal = new BigDecimal(v).setScale(3, RoundingMode.UP);
        return bigDecimal.doubleValue();
    }
}
